import React from "react"
import classes from './AnswerItem.css'

const AnswerItem = (props) => {
    const cls = [classes.AnswerItem]

    if (props.stand) {
        cls.push(classes[props.stand])
    }

    return (
        <li className={cls.join(' ')}
            onClick={()=> props.onAnswerClick(props.answer.id)}
        >
            {props.answer.text}
        </li>
    )
}

export default AnswerItem